<?php

class ValidatorZipCode extends sfValidatorNumber {
  
    protected function doClean($value)
  {
    $value = parent::doClean($value);
    
      if (strlen($value) != 5)
    {
      throw new sfValidatorError($this, 'invalid');
    }
    
    return $value;
  }
}